﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SdmxMl.UC;

namespace SdmxMl.Panels
{
    public partial class DlgDiffusionStatus : Form
    {
        private string _state;
        public string State
        {
            get { return _state; }
        }

        public DlgDiffusionStatus(ImageList iml, int index)
        {
            InitializeComponent();
            comboBoxImg1.ImageList = iml;

            // not needed but… no icon for index -1 else
            comboBoxImg1.DropDownStyle = ComboBoxStyle.DropDownList;
            // just pass these in instead of strings, class included below
            // specify a valid imageIndex
            comboBoxImg1.Items.Add(new ComboBoxImgItem("No diffusion", 0));
            comboBoxImg1.Items.Add(new ComboBoxImgItem("Public", 1));
            comboBoxImg1.Items.Add(new ComboBoxImgItem("Internal", 2));

            comboBoxImg1.SelectedIndex = index;

        }

        private void buttonSetStatus_Click(object sender, EventArgs e)
        {
            _state = comboBoxImg1.SelectedIndex.ToString();
            DialogResult = DialogResult.OK;
        }
    }
}
